package android.medicalcloud.com.yiapp.yilian.model;

import android.medicalcloud.com.yiapp.base.utils.StringTools;

import java.io.Serializable;

/**
 * Created by wanggenlin on 17-5-24.
 */
public class SchReferModel implements Serializable {
    String date;
    String usable;

    public String getDate() {
        return date;
    }

    public String getUsable() {
        return usable;
    }

    public int getDay(){
        if (StringTools.isNullOrEmpty(date)){
            return 0;
        }
        String[] array =  date.split("-");
        if (array!=null){
            String s = array[array.length-1];
            try {
              return Integer.parseInt(s);
            }catch (Exception e){
            }
        }
        return 0;
    }

    public int getUseble(){
        try {
            return Integer.parseInt(usable);
        }catch (Exception e){
            return 4;
        }
    }
}
